package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.entity.Subjects;
import com.dingreading.cloud.common.base.R;
import com.mybatisflex.core.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface SubjectsService extends IService<Subjects> {

    long duplicationSubjectMainName(Long id, String name);

    void updateSubjectMainIdAndNodes(Long id);

    int getMaxShowOrder();

    boolean updateEnabledBySubjectMainId(Long subjectMainId, Integer enabled);

    boolean updateEnabledByParentId(Long parentId, Integer enabled);

    // 获取主科目列表
    List<Subjects> mainListByEnabled(Integer enabled);

    List<Subjects> getBySubjectMainId(Long subjectMainId);

    Integer getMaxSubjectOrderByPatentId(Long parentId);

    Subjects getGtSubjectOrder(Long parentId, Integer subjectOrder);

    Subjects getLtSubjectOrder(Long parentId, Integer subjectOrder);

    // 设置序号
    void updateSubjectOrder(Long id, Integer orderNum);

    boolean updateLessonNum(Long id, int num);

    R<Object> uploadInfo(String headStaffUid, String headStaffName, Long id, String bookIsbn, String bookPress, String bookImg);

    R<Object> getSubjectDto(HttpServletRequest request, String headStaffUid, String headStaffName, Long id);

    Subjects getByUid(String subjectUid);

    void updateNodes(Long id, String nodes);

    /*双思学科修改*/
    List<Subjects> listByMainIdAndLevelIndexAndNameIn(long mainId, int levelIndex, List<String> nameList);

    Subjects getByMainIdAndNameAndLevelIndex(long mainId, String name, int levelIndex);

    List<Subjects> listByParentId(Long patentId);

    List<Subjects> listByParentIdIn(List<Long> patentIdList);

    Subjects getByParentIdAndSubjectName(Long patentId, String subjectName, int levelIndex);

    List<Subjects> listByVideoUrlIsNotNull();
}
